|
|
@@ -3,6 +3,14 @@ class @AgentEditPage
|
3
|
3
|
$("#agent_source_ids").on "change", @showEventDescriptions
|
4
|
4
|
@showCorrectRegionsOnStartup()
|
5
|
5
|
|
|
6
|
+ $("#agent_name").each ->
|
|
7
|
+ # Select the number suffix if this is a cloned agent.
|
|
8
|
+ if matches = this.value.match(/ \(\d+\)$/)
|
|
9
|
+ this.focus()
|
|
10
|
+ if this.selectionStart?
|
|
11
|
+ this.selectionStart = matches.index
|
|
12
|
+ this.selectionEnd = this.value.length
|
|
13
|
+
|
6
|
14
|
# The type selector is only available on the new agent form.
|
7
|
15
|
if $("#agent_type").length
|
8
|
16
|
$("#agent_type").on "change", => @handleTypeChange(false)
|